package com.lagou.edu.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

/**
 * @author
 */
@RefreshScope
@Configuration
public class lagouCloudConfiguration {

    @Bean(name = "lagouMail")
    @RefreshScope
    @ConfigurationProperties(prefix = "spring.mail")
    public JavaMailSender getJavaMailSender(){
        return new JavaMailSenderImpl();
    }
}
